<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>std.base64</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "std.base64";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/std.base64.html" class="symbol">std.base64</a></h1>
  
<div class="summary">Encodes/decodes MIME base64 data.</div>
<p class="sec_header">References:</p><a href="http://en.wikipedia.org/wiki/Base64">Wikipedia Base64</a><br/>
        <a href="http://www.ietf.org/rfc/rfc2045.txt">RFC 2045</a><br/>
<dl>
<dt class="decl">class <a class="symbol _class" name="Base64Exception" href="./htmlsrc/std.base64.html#L43" kind="class" beg="43" end="49">Base64Exception</a> : Exception; <a title="Permalink to this symbol" href="#Base64Exception" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L43">#</a></dt>
<dd class="ddef">
<div class="summary"></div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="Base64Exception.this" href="./htmlsrc/std.base64.html#L45" kind="ctor" beg="45" end="48">this</a><span class="params">(string <em>msg</em>)</span>; <a title="Permalink to this symbol" href="#Base64Exception.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L45">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">class <a class="symbol _class" name="Base64CharException" href="./htmlsrc/std.base64.html#L55" kind="class" beg="55" end="61">Base64CharException</a> : Base64Exception; <a title="Permalink to this symbol" href="#Base64CharException" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L55">#</a></dt>
<dd class="ddef">
<div class="summary"></div>
<dl>
<dt class="decl"><a class="symbol _ctor" name="Base64CharException.this" href="./htmlsrc/std.base64.html#L57" kind="ctor" beg="57" end="60">this</a><span class="params">(string <em>msg</em>)</span>; <a title="Permalink to this symbol" href="#Base64CharException.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L57">#</a></dt>
<dd class="ddef"></dd></dl></dd>
<dt class="decl">auto <a class="symbol _variable" name="array" href="./htmlsrc/std.base64.html#L64" kind="variable" beg="64" end="64">array</a>; <a title="Permalink to this symbol" href="#array" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L64">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">uint <a class="symbol _function" name="encodeLength" href="./htmlsrc/std.base64.html#L71" kind="function" beg="71" end="78">encodeLength</a><span class="params">(uint <em>slen</em>)</span>; <a title="Permalink to this symbol" href="#encodeLength" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L71">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the number of bytes needed to encode a string of length slen.</div></dd>
<dt class="decl">char[] <a class="symbol _function" name="encode" href="./htmlsrc/std.base64.html#L89" kind="function" beg="89" end="145">encode</a><span class="params">(string <em>str</em>, char[] <em>buf</em>)</span>; <a title="Permalink to this symbol" href="#encode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L89">#</a></dt>
<dd class="ddef">
<div class="summary">Encodes str[] and places the result in buf[].</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>str</em></td><td>string to encode</td></tr>
<tr><td><em>buf</em></td><td>destination buffer, must be large enough for the result.</td></tr></table>
<p class="sec_header">Returns:</p>slice into buf[] representing encoded result</dd>
<dt class="decl">string <a class="symbol _function" name="encode:2" href="./htmlsrc/std.base64.html#L152" kind="function" beg="152" end="155">encode</a><span class="params">(string <em>str</em>)</span>; <a title="Permalink to this symbol" href="#encode:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L152">#</a></dt>
<dd class="ddef">
<div class="summary">Encodes str[] and returns the result.</div></dd>
<dt class="decl"><a class="symbol _unittest" name="unittest" href="./htmlsrc/std.base64.html#L157" kind="unittest" beg="157" end="164">unittest</a>; <a title="Permalink to this symbol" href="#unittest" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L157">#</a></dt>
<dd class="ddef"></dd>
<dt class="decl">uint <a class="symbol _function" name="decodeLength" href="./htmlsrc/std.base64.html#L171" kind="function" beg="171" end="174">decodeLength</a><span class="params">(uint <em>elen</em>)</span>; <a title="Permalink to this symbol" href="#decodeLength" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L171">#</a></dt>
<dd class="ddef">
<div class="summary">Returns the number of bytes needed to decode an encoded string of this
 length.</div></dd>
<dt class="decl">char[] <a class="symbol _function" name="decode" href="./htmlsrc/std.base64.html#L188" kind="function" beg="188" end="270">decode</a><span class="params">(string <em>estr</em>, char[] <em>buf</em>)</span>; <a title="Permalink to this symbol" href="#decode" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L188">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes str[] and places the result in buf[].</div>
<p class="sec_header">Params:</p>
<table class="params">
<tr><td><em>str</em></td><td>string to encode</td></tr>
<tr><td><em>buf</em></td><td>destination buffer, must be large enough for the result.</td></tr></table>
<p class="sec_header">Returns:</p>slice into buf[] representing encoded result
<p class="sec_header">Errors:</p>Throws Base64Exception on invalid base64 encoding in estr[].
        Throws Base64CharException on invalid base64 character in estr[].</dd>
<dt class="decl">string <a class="symbol _function" name="decode:2" href="./htmlsrc/std.base64.html#L279" kind="function" beg="279" end="282">decode</a><span class="params">(string <em>estr</em>)</span>; <a title="Permalink to this symbol" href="#decode:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L279">#</a></dt>
<dd class="ddef">
<div class="summary">Decodes estr[] and returns the result.</div>
<p class="sec_header">Errors:</p>Throws Base64Exception on invalid base64 encoding in estr[].
        Throws Base64CharException on invalid base64 character in estr[].</dd>
<dt class="decl"><a class="symbol _unittest" name="unittest:2" href="./htmlsrc/std.base64.html#L285" kind="unittest" beg="285" end="297">unittest</a>; <a title="Permalink to this symbol" href="#unittest:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/std.base64.html#L285">#</a></dt>
<dd class="ddef"></dd></dl>
</div>
<div id="footer">
  <p>Copyright © 1999-2008 by Digital Mars ®, All Rights Reserved.</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Sun Dec 28 04:26:33 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>